<?php

/**
 * This is the model class for table "pgwtupt".
 *
 * The followings are the available columns in table 'pgwtupt':
 * @property integer $ptu_id
 * @property string $ptu_pt
 * @property integer $ptu_admin_laki
 * @property integer $ptu_admin_perm
 * @property integer $ptu_lap_laki
 * @property integer $ptu_lap_perm
 * @property integer $ptu_jml_laki
 * @property integer $ptu_jml_perm
 * @property integer $ptu_tahun
 */
class Pgwtupt extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Pgwtupt the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'pgwtupt';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ptu_admin_laki, ptu_admin_perm, ptu_lap_laki, ptu_lap_perm, ptu_jml_laki, ptu_jml_perm, ptu_tahun', 'numerical', 'integerOnly'=>true),
			array('ptu_pt', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ptu_id, ptu_pt, ptu_admin_laki, ptu_admin_perm, ptu_lap_laki, ptu_lap_perm, ptu_jml_laki, ptu_jml_perm, ptu_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ptu_id' => 'Ptu',
			'ptu_pt' => 'Ptu Pt',
			'ptu_admin_laki' => 'Ptu Admin Laki',
			'ptu_admin_perm' => 'Ptu Admin Perm',
			'ptu_lap_laki' => 'Ptu Lap Laki',
			'ptu_lap_perm' => 'Ptu Lap Perm',
			'ptu_jml_laki' => 'Ptu Jml Laki',
			'ptu_jml_perm' => 'Ptu Jml Perm',
			'ptu_tahun' => 'Ptu Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ptu_id',$this->ptu_id);
		$criteria->compare('ptu_pt',$this->ptu_pt,true);
		$criteria->compare('ptu_admin_laki',$this->ptu_admin_laki);
		$criteria->compare('ptu_admin_perm',$this->ptu_admin_perm);
		$criteria->compare('ptu_lap_laki',$this->ptu_lap_laki);
		$criteria->compare('ptu_lap_perm',$this->ptu_lap_perm);
		$criteria->compare('ptu_jml_laki',$this->ptu_jml_laki);
		$criteria->compare('ptu_jml_perm',$this->ptu_jml_perm);
		$criteria->compare('ptu_tahun',$this->ptu_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}